const mongoose = require('mongoose');
const { cinemas } = require('./data/cinemas');

// 创建数据结构
const cinemaSchema = new mongoose.Schema({
    name:String,
    address:String,
    phone:Number,
    price:Number,
    distance:String,
    status:String,
})

// 创建数据模型
const cinemasModel = mongoose.model('cinemas',cinemaSchema,'cinemas');

// 创建连接
mongoose.connect('mongodb://tangzhenhua:Lovo123456@182.92.214.223:8084/chenpeng',
{
    useNewUrlParser: true,
    useUnifiedTopology: true,
    auth: { authSource: "admin" }
},

async ()=>{
    // 创建影院数据
    await cinemasModel.create(cinemas);
})

